﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace msBsc.WebUi.mMall.Buyer
{
    public partial class mfSystemMessList : msBsc.Cls.mBPUser
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public override void DoAction()
        {
            if (this.strAction=="init")
            {
                getSystemMessList();
            }
        }

        protected void getSystemMessList()
        {
            string djackId = msBsc.SvRef.UserInfo.Operator;
            if (string.IsNullOrEmpty(djackId))
            {
                this.ExecJScript(@"window.location.reload(true);");
                return;
            }
            string pageRows = this.GetParamHtValue("pageRows");
            string pageNum = this.GetParamHtValue("pageNum");
            using (msBsc.AppLogic.DataAlc.CBizMessageSystem systemMess=new AppLogic.DataAlc.CBizMessageSystem())
            {
                int pRows = 10;
                int.TryParse(pageRows, out pRows);
                int pNum = 1;
                int.TryParse(pageNum, out pNum);
                DataTable dt = systemMess.GetMsgList(djackId, 3, pRows, pNum);
                if (dt==null||dt.Rows.Count<1)
                {
                    return;
                }
                string ret = msBsc.AppLogic.Cfg.HttpTools.GetJsonByTable(dt, "", "", 1, 1000, "");
                this.ExecJScript(@"showMessageList(" + ret + ")");
            }
        }

    }
}